<extend name="Public/layout" />

<block name="content">
<section class="wrapper site-min-height">
    <!-- page start-->
    <section class="panel">
        <header class="panel-heading">
            用户列表
            <span class="pull-right">
                <a href="{:U('Admin/User/add')}" class=" btn btn-success btn-xs">
                    <i class="fa fa-plus"></i> 新增
                </a>
                <button type="button" class="btn btn-warning btn-xs" onclick="window.location.reload()">
                    <i class="fa fa-refresh"></i> 刷新
                </button>
            </span>
        </header>
        <div class="panel-body">
            <div class="row">
                <div class="col-md-12">
                    <form class="form-inline" role="form" action="{:U('Admin/User/index')}" method="get">
                        <div class="form-group">
                            <label class="sr-only" for="user_name">用户名</label>
                            用户名 <input name="user_name" value="{$Think.get.user_name}" type="text" id="user_name" class="form-control"  placeholder="请输入用户名">
                        </div>
                        <div class="form-group">
                            <label class="sr-only" for="user_phone">手机号码</label>
                            手机号码 <input name="user_phone" value="{$Think.get.user_phone}" type="text" id="user_phone" class="form-control"  placeholder="请输入用户名">
                        </div>
                        <div class="form-group">
                            <label class="sr-only" for="user_role">用户类别</label>
                            用户类别
                            <select name="user_role" id="user_role" class="form-control">
                                <option value="">请选择</option>
                                <option value="1" <eq name="Think.get.user_role" value="1">selected='selected'</eq>>
                                鸽主
                                </option>
                                <option value="2" <eq name="Think.get.user_role" value="2">selected='selected'</eq>>公棚</option>
                            </select>
                        </div>

                        <button type="submit" class="btn btn-info">
                            <i class="fa fa-search"></i>
                            搜索
                        </button>
                    </form>
                </div>

            </div>
        </div>
        <hr style="margin:1px 0px; "/>
        <div class="panel-body">
            <div class="table-responsive" tabindex="1" style="overflow: hidden; outline: none;">
                <table class="table table-bordered table-hover">
                    <thead>
                    <tr>
                        <th>用户编号</th>
                        <th>用户名</th>
                        <th>手机号码</th>
                        <th>用户类型</th>
                        <th>注册时间</th>
                        <th>注册IP</th>
                        <th>登录时间</th>
                        <th>登录IP</th>
                        <th >操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <notempty name="list.list">

                    <volist name="list.list" id="vo">
                    <tr>
                        <td>{$vo.user_id}</td>
                        <td>{$vo.user_name}</td>
                        <td>{$vo.user_phone}</td>
                        <td>{$vo['user_role']==1?'鸽主':'公棚'}</td>
                        <td>{$vo.add_time}</td>
                        <td>{$vo.add_ip}</td>
                        <td>{$vo.login_time}</td>
                        <td>{$vo.login_ip}</td>
                        <td>
                            <a href="{:U('Admin/User/show')}?id={$vo.id}" class="btn btn-info btn-xs">
                                <i class="fa fa-eye"></i> 查看
                            </a>
                            <a href="{:U('Admin/User/edit')}?id={$vo.id}" class="btn btn-primary btn-xs">
                                <i class="fa fa-pencil"></i> 编辑
                            </a>
                            <a href="javascript:;" ajax-msg="确认删除?" ajax-url="{:U('Admin/User/del')}?id={$vo.id}" class="btn btn-danger btn-xs ajax-action-btn">
                                <i class="fa fa-trash-o"></i> 删除
                            </a>
                        </td>
                    </tr>
                    </volist>
                        <else/>
                        <tr><td colspan="9" align="center">暂无数据</td></tr>
                    </notempty>
                    </tbody>
                </table>
            </div>
            <!--分页-->
            <div class="text-center">
                {$list.page}
            </div>
        </div>
    </section>
</section>
</block>

<block name="javascript">
    <script type="text/javascript" src="__ADMIN__/assets/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    <script type="text/javascript" src="__ADMIN__/assets/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
    <script>
    //菜单高
    MenuHighlight('{:U("Admin/SmsLog/index")}');
    //日期选择器
    $('#start_date,#end_date').datepicker();
    </script>

</block>

<block name="style">
    <link href="__ADMIN__/assets/bootstrap-datepicker/css/bootstrap-datepicker.css" rel="stylesheet" />
</block>
